<?php
define('MODULE_NAME','cp');
$actions = array('yu', 'mycoupon', 'app_userinfo', 'myred', 'sendred', 'qiangred', 'myredlog', 'myredview', 'sendcard', 'sendcardimg', 'mycard', 'mycardview','delcardimg', 'delcard', 'setcardpos');
$action = 'yu';

if(isset($_REQUEST['action']))
{
	$action = strtolower($_REQUEST['action']);
	if(!in_array($action,$actions))
		$action = 'yu';
}

define('ACTION_NAME',$action);

require dirname(__FILE__).'/core/fanwe.php';
$fanwe = &FanweService::instance();
$fanwe->initialize();

if($_FANWE['uid'] == 0) {
	if(isset($_GET['ajax']))
		exit(json_encode(array('error' => 'not_login')));
	else
		fHeader("location: ".FU('user/login'));
}
	
require fimport('module/cp');
switch(ACTION_NAME)
{
	case 'yu':
		CpModule::yu();
	break;
	case 'mycoupon':
		CpModule::mycoupon();
	break;
	case 'app_userinfo':
		CpModule::app_userinfo();
	break;
	case 'myred':
		CpModule::myred();
	break;
	case 'sendred':
		CpModule::sendred();
	break;
	case 'qiangred':
		CpModule::qiangred();
	break;
	case 'myredlog':
		CpModule::myredlog();
	break;
	case 'myredview':
		CpModule::myredview();
	break;
	case 'sendcard':
		CpModule::sendcard();
	break;
	case 'sendcardimg':
		CpModule::sendcardimg();
	break;
	case 'mycard':
		CpModule::mycard();
	break;
	case 'mycardview':
		CpModule::mycardview();
	break;
	case 'delcardimg':
		CpModule::delcardimg();
	break;
	case 'delcard':
		CpModule::delcard();
	break;
	case 'setcardpos':
		CpModule::setcardpos();
	break;
}

?>